<template>
	<view class="container">
		<view class="inner">
			<textarea 
			placeholder="可输入物品描述或送件要求"
			id="textarea"
			maxlength="50"
			v-on:keyup="content()"
			v-on:compositionstart="importStart()"
			v-on:compositionend="importEnd()"
			v-model="payload.content"></textarea>
			<view class="number">输入字数：{{ conterNum }}/50</view>
		</view>
	</view>
</template>

<script>
	export default { 
	    data() {  
	        return {
				payload:{
				 content: '',
				},
				conterNum: 0,
				cInput: false
			}  
	    },
		onNavigationBarButtonTap() { 
				this.$api.prePage().remark=this.payload.content
		        uni.navigateBack()
		},
		onLoad:function(input){
			
		},
		 methods:{
				content() {
				 let self = this;
				 if (self.cInput == false) {
				 self.conterNum = self.payload.content.length;
				 }
				},
				importStart() {
				 this.cInput = true;
				},
				importEnd() {
				 this.cInput = false;
				 this.write();
				}
				
		}
	}  
</script>

<style lang="scss">
.container{
	.inner{
		height: 360rpx;
		margin-left: 40rpx;
		margin-right: 40rpx;
		background-color: #FAFAFA;
	}
	.number{
		margin-right: 20rpx;
		text-align: right;
		font-size: 24rpx;
	}
}
</style>
